using System;
using System.ComponentModel;
using System.Xml.Serialization;

namespace com.exceptionalsoftware.spacetime.KML
{
	[Serializable()]
    [XmlType(TypeName = "PhotoOverlayType")]
    public class PhotoOverlay : Overlay
	{
        private double rotationField;
        private bool rotationFieldSpecified;
        private ViewVolume viewVolumeField;
        private ImagePyramid imagePyramidField;
        private Point pointField;
        private ShapeEnum shapeField;
        private bool shapeFieldSpecified;

        public PhotoOverlay()
        {
            this.rotationField = 0;
            this.shapeField = ShapeEnum.Rectangle;
        }


        [XmlElement(ElementName = "rotation", DataType = "double")]
        [DefaultValue(0)]
        public double Rotation
        {
            get { return this.rotationField; }
            set { this.rotationField = value; }
        }

        [XmlIgnore()]
        public bool rotationSpecified
        {
            get
            {
                return this.rotationFieldSpecified;
            }
            set
            {
                this.rotationFieldSpecified = value;
            }
        }

        [XmlElement(ElementName = "ViewVolume", Type = typeof(ViewVolume))]
        public ViewVolume ViewVolume
        {
            get
            {
                return this.viewVolumeField;
            }
            set
            {
                this.viewVolumeField = value;
            }
        }

        [XmlElement(ElementName = "ImagePyramid", Type = typeof(ImagePyramid))]
        public ImagePyramid ImagePyramid
        {
            get { return this.imagePyramidField; }
            set { this.imagePyramidField = value; }
        }

        [XmlElement(ElementName = "Point", Type = typeof(Point))]
        public Point Point
        {
            get { return this.pointField; }
            set { this.pointField = value; }
        }

        [XmlElement(ElementName = "shape", Type = typeof(ShapeEnum))]
        [DefaultValue(ShapeEnum.Rectangle)]
        public ShapeEnum shape
        {
            get { return this.shapeField; }
            set { this.shapeField = value; }
        }

        [XmlIgnore()]
        public bool shapeSpecified
        {
            get { return this.shapeFieldSpecified; }
            set { this.shapeFieldSpecified = value; }
        }
    }


    [XmlType(TypeName = "shapeEnumType")]
    public enum ShapeEnum
    {
        [XmlEnum(Name = "rectangle")]
        Rectangle,

        [XmlEnum(Name = "cylinder")]
        Cylinder,

        [XmlEnum(Name = "sphere")]
        Sphere
    }
}

